package com.nd.android.payment.business.http;

import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.message.BasicHeader;

import com.common.StarAppConfig;
import com.common.android.utils.httpRequest.ISetHeadAgent;
import com.product.android.business.ApplicationVariable;
import com.product.android.business.config.Configuration;
/**
 * 中间层http请求header
 * 
 * <br>Created 2014-6-12 上午9:59:00
 * @version  
 * @author   zhangqr		
 *
 * @see
 */
public class MiddleRequestHeader implements ISetHeadAgent{

    @Override
    public void setHttpHeader(HttpRequestBase request) {
//    	request.removeHeaders("COOKIE");
//        request.addHeader(new BasicHeader("COOKIE", "PHPSESSID="+ApplicationVariable.INSTANCE.getLocalSid())); 
        
    	// 会话SESSIONID
        request.addHeader(new BasicHeader("SID", ApplicationVariable.INSTANCE.getLocalSid()));
        
        // 明星标签ID 
        request.addHeader(new BasicHeader("TAGID",String.valueOf(Configuration.TAG_ID)));
        
        // 当前登录的用户ID 
        request.addHeader(new BasicHeader("CUID", String.valueOf(ApplicationVariable.INSTANCE.getOapUid())));
        // 客户端类型
        request.addHeader(new BasicHeader("CLIENTTYPE","android"));
        // 应用ID
        request.addHeader(new BasicHeader("APPID",  String.valueOf(Configuration.OAP_APPID)));
        // 云ID
        request.removeHeaders("CLOUDID");
        request.addHeader(new BasicHeader("CLOUDID", Configuration.CLOUNDID));
        request.addHeader(new BasicHeader("apikey", StarAppConfig.getConfig(StarAppConfig.CONFIG_API_KEY)));
        
        request.addHeader(new BasicHeader("MOCK", "0"));
    }

}
